import request from "@/utils/request";

const apiPrefix = "/admin/system/menu";

export async function findNodes() {
  return await request({
    url: `${apiPrefix}/findNodes`,
    method: "get",
  });
}

export async function save(menu) {
  return await request({
    url: `${apiPrefix}/save`,
    method: "post",
    data: menu,
  });
}

export async function removeById(id) {
  return await request({
    url: `${apiPrefix}/remove/${id}`,
    method: "delete",
  });
}

export async function update(menu) {
  return await request({
    url: `${apiPrefix}/update`,
    method: "post",
    data: menu,
  });
}
